<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
  	<base href="<%=basePath%>">
  	<!-- base的作用是为本页面所有的表单和超链接指定显示内容的框架！ <base target="right">-->
    <title>head</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Loading Bootstrap -->
    <link href="${pageContext.request.contextPath }/css/bootstrap.css" rel="stylesheet">

    <!-- Loading Flat UI -->
    <link href="${pageContext.request.contextPath }/css/flat-ui.css" rel="stylesheet">

    <link rel="shortcut icon" href="images/favicon.ico">
	
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/head.css">
	<script src="js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript">	
	var ws; //一个ws意味着一个管道
	var target = "ws:localhost:8080/ParkServer/websocket?parkID=${sessionScope.parkID}";
	window.onload = function() {
		//进入聊天页面，就打开socket通道	

		if ('WebSocket' in window) {
			ws = new WebSocket(target);
		} else if ('MozWebSocket' in window) {
			ws = new MozWebSocket(target);
		} else {
			alert('WebSocket is not supported by this browser.');
			return;
		}
		ws.onmessage=function(event){
				var dv = document.getElementById("order");
				dv.innerHTML=event.data;
				alert('123');
				
			}
	}	
	
	function change(){
		var d = document.getElementById("order");
		d.innerHTML="无新订单";
	}
	function newa(){
		alert("eger");
		$("#bg_music").append('<embed id="m_bg_music"  loop=true  volume="90" autostart=true hidden=true src="news.mp3" />');
  	}
  </script> 
  </head>
  
  
  
  <body style="overflow-y: hidden">
  
  <div id="bg_music"></div>
	<div id="container" >
  	 <div id="head_top" >
		<div id="head_logo">停车场车位管理系统</div>
		<div id="head_welcome">${sessionScope.account},欢迎你!&nbsp;&nbsp;&nbsp;&nbsp;今天是<%=java.util.Calendar.getInstance().get(Calendar.YEAR)%>年
		<%=java.util.Calendar.getInstance().get(Calendar.MONTH)+1%>月<%=java.util.Calendar.getInstance().get(Calendar.DAY_OF_MONTH)%>日</div>
  	 </div>
  	 <div id="head_bottom" >
		<div class="navbar navbar-inverse">  
  			<div class="navbar-collapse collapse navbar-collapse-01">
   				<ul class="nav navbar-nav navbar-right">
   					
   					<li >
	        			<a id="order" onclick="change()" href="jsp/pages/testWebSocket.jsp" target="right" >无新订单
	        				<span class="navbar-unread"></span>
	        			</a>
	      			</li>
	      			
	      			<li>
	        			<a href="jsp/pages/head.jsp">系统公告
	        				<span class="navbar-unread"></span>
	        			</a>
	      			</li>
	      				
	      			<li>
	        			<a href="showAdminInfo.action" target="right">个人信息
	        				<span class="navbar-unread"></span>
	        			</a>
      				</li>
      				
      				<li>
	        			<a href="jsp/admin/changePwd.jsp" target="right">修改密码
	        				<span class="navbar-unread"></span>
	        			</a>
      				</li>
      				
      				<li>
	        			<a href="jsp/pages/head.jsp">系统帮助
	        				<span class="navbar-unread"></span>
	        			</a>
      				</li>
      				
      				<li>
	        			<a onClick="parent.location.href=''">退出系统
	        				<span class="navbar-unread"></span>
	        			</a>
      				</li>
    			</ul>     
  			</div>      
		</div>
  	 </div>	 
  </div>
  
  <!-- Load JS here for greater good =============================-->
    
    
    <script src="js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="js/jquery.ui.touch-punch.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-select.js"></script>
    <script src="js/bootstrap-switch.js"></script>
    <script src="js/flatui-checkbox.js"></script>
    <script src="js/flatui-radio.js"></script>
    <script src="js/jquery.tagsinput.js"></script>
    <script src="js/jquery.placeholder.js"></script>
  </body>
</html>
